Skip to content

Conversation

@TheodorNEngoy
Copy link

This removes shell=True usage from the CLI helper path (a common security footgun).

Changes:

  • _get_npx_command() now returns a subprocess-friendly command prefix and uses COMSPEC /c only when npx is a .cmd/.bat shim.
  • mcp dev runs npx @modelcontextprotocol/inspector without shell=True.
  • URL elicitation example uses webbrowser.open() for cross-platform browser opening.

Tests:

  • uv run pytest -q tests/cli/test_utils.py
  • uv run ruff check src/mcp/cli/cli.py tests/cli/test_utils.py examples/snippets/clients/url_elicitation_client.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant